Skip to content

fix(translations): authorize source target fanout - #23218

Open
nijel wants to merge 2 commits into
mainfrom
review/oss-next-nt4vwshz
Open

nijel wants to merge 2 commits into
mainfrom
review/oss-next-nt4vwshz

Conversation

@nijel

@nijel nijel commented Nov 29, 2026

Copy link
Copy Markdown
Member

Check each receiving language before copying a target or approval state, and keep source glossary additions untranslated elsewhere.

Discovered by Anthropic’s OSS Scanner, as vulnerability ANT-2026-NT4VWSHZ.

@nijel nijel added this to the 2026.12 milestone Nov 29, 2026
@nijel nijel self-assigned this Nov 29, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 29, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-29T20:49:43.653764Z 7cdead4 New commits
🔒 Security Review ✅ Completed 2026-11-29T18:37:48.131643Z 7b3e556 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 6 files

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread weblate/glossary/tests.py Resolved
@codecov

codecov Bot commented Nov 29, 2026

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
15834 1 15833 913
View the top 1 failed test(s) by shortest run time
weblate.glossary.tests.GlossaryTest::test_add_source_does_not_translate_other_languages
Stack Traces | 0.198s run time
self = <weblate.glossary.tests.GlossaryTest testMethod=test_add_source_does_not_translate_other_languages>

    def test_add_source_does_not_translate_other_languages(self) -> None:
>       self.do_add_unit(language="en")

weblate/glossary/tests.py:1017: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
weblate/glossary/tests.py:1007: in do_add_unit
    self.assertEqual(content["responseCode"], expected_status)
E   AssertionError: 403 != 200

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

Check each receiving language before copying a target or approval state, and keep source glossary additions untranslated elsewhere.

Discovered by Anthropic’s OSS Scanner, as vulnerability ANT-2026-NT4VWSHZ.
Exercise glossary addition through a translated language and verify that it leaves other languages untouched. The source-language form is read-only for this test user and correctly returns 403.

Discovered by Anthropic's OSS Scanner, as vulnerability ANT-2026-NT4VWSHZ.
@nijel
nijel force-pushed the review/oss-next-nt4vwshz branch from 7b3e556 to 7cdead4 Compare November 29, 2026 20:48

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 1 file (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="weblate/glossary/tests.py">

<violation number="1" location="weblate/glossary/tests.py:1016">
P2: The source-language fanout case is no longer tested. The removed test covered adding a term via `en` without `terminology`, and nothing replaces it. Add a test that calls `make_manager()` and then `do_add_unit(language="en")`, asserting that only the source unit and no other language units are created.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Turn on auto-fix | Re-trigger cubic

Comment thread weblate/glossary/tests.py
# Should be added to the source and translation only
self.assertEqual(Unit.objects.count(), start + 2)

def test_add_translation_does_not_translate_other_languages(self) -> None:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: The source-language fanout case is no longer tested. The removed test covered adding a term via en without terminology, and nothing replaces it. Add a test that calls make_manager() and then do_add_unit(language="en"), asserting that only the source unit and no other language units are created.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At weblate/glossary/tests.py, line 1016:

<comment>The source-language fanout case is no longer tested. The removed test covered adding a term via `en` without `terminology`, and nothing replaces it. Add a test that calls `make_manager()` and then `do_add_unit(language="en")`, asserting that only the source unit and no other language units are created.</comment>

<file context>
@@ -1013,19 +1013,15 @@ class GlossaryTest(ReusableViewTestCase):
 
-    def test_add_source_does_not_translate_other_languages(self) -> None:
-        self.do_add_unit(language="en")
+    def test_add_translation_does_not_translate_other_languages(self) -> None:
+        self.do_add_unit(language="cs")
         units = Unit.objects.filter(
</file context>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant